-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enh: Now able to handle "large output" from nrpe agent. #16
base: master
Are you sure you want to change the base?
Conversation
I finally had time to test you patch. Unfortunately it does not work :( On the second NRPE.read() if fails to unpack the data from the buffer, because the second buffer is too small:
If I have the time I'll write a small python script using the asyncore module to query the NRPE daemon. Maybe that will help. |
What is the exact nrpe server you use ? |
Note: because on my side i had not access to any such one (supporting the large buffer) and made this PR, with only the references i mentionned in the other thread, and without any real attempt actually.. So we should have expected such first results.. ;) |
I'm using an up to date nrpe server with the opscode patch: https://web.archive.org/web/20100123200325/http://altinity.blogs.com/dotorg/nrpe_multiline.patch I managed to create a python script using the asyncore module that works with such an nrpe server: https://github.com/xorpaul/shinken_nrpe/blob/master/check_nrpe.py In this script I'm using asyncore.loop(). We would just need to add a loop somewhere in the nrpe booster, but I don't know where this should be added. My best guess is somewhere in the Nrpe_poller class. |
Damn, I checked your code and it should be the same as far as I can tell.. Yeah this mod-booster-nrpe code isn't necessarily all clear and simple.. it could be slightly enhanced regarding that (I imagine it could be smaller (and clearer) of at least up to 25% of its LOC).
it's in the and that's it.. (asyncore.poll2() called in a loop is equivalent to .. asyncore.loop() ;) ) |
Okay, then I'm also clueless why the second self.recv doesn't receive the rest of the output. I just changed my script to use asyncore.poll2() and it still worked like you said: https://github.com/xorpaul/shinken_nrpe/compare/poll2?expand=1 I also tried replacing the asyncore.poll2() with asyncore.loop() in the Nrpe_poller class, but with the same result :/ Well, no point in loosing sleep over this. It's cosmetic enhancement anyway. As long as my status line + perfdata stays under 1 kByte everything is okay. I will replace the NRPE server with my own golang clone https://github.com/xorpaul/gorpe in the long run anywat. It's using simple HTTP so it should be easy enough for me to provide a booster-gorpe module for shinken :) |
No description provided.